/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package aqu.persistencia.entity;

import java.io.Serializable;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author Verito Ramirez
 *         Victor Jaramillo
 */
@Entity
@Table(name = "cxc_cabeceraretencion")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "CxcCabeceraRetencion.findAll", query = "SELECT c FROM CxcCabeceraRetencion c"),
    @NamedQuery(name = "CxcCabeceraRetencion.findBycxcCodigoCabret", query = "SELECT c FROM CxcCabeceraRetencion c WHERE c.cxcCodigoCabret = :cxcCodigoCabret"), 
    @NamedQuery(name = "CxcCabeceraRetencion.findBycxcFechaEmisionCabret", query = "SELECT c FROM CxcCabeceraRetencion c WHERE c.cxcFechaEmisionCabret = :cxcFechaEmisionCabret"),
    @NamedQuery(name = "CxcCabeceraRetencion.findBycxcFechaRetencion", query = "SELECT c FROM CxcCabeceraRetencion c WHERE c.cxcFechaEmisionCabret between :conInicio and :conFin"),
    @NamedQuery(name = "CxcCabeceraRetencion.findBycxcTipoComprobanteCabret", query = "SELECT c FROM CxcCabeceraRetencion c WHERE c.cxcTipoComprobanteCabret = :cxcTipoComprobanteCabret"),
    @NamedQuery(name = "CxcCabeceraRetencion.findBycxcNumeroCabret", query = "SELECT c FROM CxcCabeceraRetencion c WHERE c.cxcNumeroCabret = :cxcNumeroCabret"),
    @NamedQuery(name = "CxcCabeceraRetencion.findBycxcObservacionCabret", query = "SELECT c FROM CxcCabeceraRetencion c WHERE c.cxcObservacionCabret = :cxcObservacionCabret"),
    @NamedQuery(name = "CxcCabeceraRetencion.findBycxcNumeroDocCabret", query = "SELECT c FROM CxcCabeceraRetencion c WHERE c.cxcNumeroDocCabret = :cxcNumeroDocCabret"),
    @NamedQuery(name = "CxcCabeceraRetencion.findBycxpCodigoTipDoc", query = "SELECT c FROM CxcCabeceraRetencion c WHERE c.cxpCodigoTipDoc = :cxpCodigoTipDoc"),
    @NamedQuery(name = "CxcCabeceraRetencion.findBycxpCodigoEstRet", query = "SELECT c FROM CxcCabeceraRetencion c WHERE c.cxpCodigoEstRet = :cxpCodigoEstRet"),
    @NamedQuery(name = "CxcCabeceraRetencion.findBycxcCodigoCli", query = "SELECT c FROM CxcCabeceraRetencion c WHERE c.cxcCodigoCli = :cxcCodigoCli")})

public class CxcCabeceraRetencion implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 10)
    @Column(name = "CXC_CODIGO_CABRET")
    private String cxcCodigoCabret;
    @Column(name = "CXC_FECHAEMISION_CABRET")
    @Temporal(TemporalType.DATE)
    private Date cxcFechaEmisionCabret;    
    @Size(max = 15)
    @Column(name = "CXC_TIPOCOMPROBANTE_CABRET")
    private String cxcTipoComprobanteCabret;
    @Size(max = 45)
    @Column(name = "CXC_NUMERO_CABRET")
    private String cxcNumeroCabret;
    @Size(max = 300)
    @Column(name = "CXC_OBSERVACION_CABRET")
    private String cxcObservacionCabret;
    @Size(max = 45)
    @Column(name = "CXC_NUMERODOC_CABRET")
    private String cxcNumeroDocCabret;
    @JoinColumn(name = "CXP_CODIGO_TIPDOC", referencedColumnName = "CXP_CODIGO_TIPDOC")
    @ManyToOne(optional = false)
    private CxpTipoDocumento cxpCodigoTipDoc;
    @JoinColumn(name = "CXP_CODIGO_ESTRET", referencedColumnName = "CXP_CODIGO_ESTRET")
    @ManyToOne(optional = false)
    private CxpEstadoRetencion cxpCodigoEstRet;
    @JoinColumn(name = "CXC_CODIGO_CLI", referencedColumnName = "CXC_CODIGO_CLI")
    @ManyToOne(optional = false)
    private CxcCliente cxcCodigoCli ;   

    public CxcCabeceraRetencion() {
    }

    public CxcCabeceraRetencion(String cxcCodigoCabret) {
        this.cxcCodigoCabret = cxcCodigoCabret;
    }

    public String getCxcCodigoCabret() {
        return cxcCodigoCabret;
    }

    public void setCxcCodigoCabret(String cxcCodigoCabret) {
        this.cxcCodigoCabret = cxcCodigoCabret;
    }

    public CxcCliente getCxcCodigoCli() {
        return cxcCodigoCli;
    }

    public void setCxcCodigoCli(CxcCliente cxcCodigoCli) {
        this.cxcCodigoCli = cxcCodigoCli;
    }

    public Date getCxcFechaEmisionCabret() {
        return cxcFechaEmisionCabret;
    }

    public void setCxcFechaEmisionCabret(Date cxcFechaEmisionCabret) {
        this.cxcFechaEmisionCabret = cxcFechaEmisionCabret;
    }

    public String getCxcNumeroCabret() {
        return cxcNumeroCabret;
    }

    public void setCxcNumeroCabret(String cxcNumeroCabret) {
        this.cxcNumeroCabret = cxcNumeroCabret;
    }

    public String getCxcNumeroDocCabret() {
        return cxcNumeroDocCabret;
    }

    public void setCxcNumeroDocCabret(String cxcNumeroDocCabret) {
        this.cxcNumeroDocCabret = cxcNumeroDocCabret;
    }

    public String getCxcObservacionCabret() {
        return cxcObservacionCabret;
    }

    public void setCxcObservacionCabret(String cxcObservacionCabret) {
        this.cxcObservacionCabret = cxcObservacionCabret;
    }

    public String getCxcTipoComprobanteCabret() {
        return cxcTipoComprobanteCabret;
    }

    public void setCxcTipoComprobanteCabret(String cxcTipoComprobanteCabret) {
        this.cxcTipoComprobanteCabret = cxcTipoComprobanteCabret;
    }

    public CxpEstadoRetencion getCxpCodigoEstRet() {
        return cxpCodigoEstRet;
    }

    public void setCxpCodigoEstRet(CxpEstadoRetencion cxpCodigoEstRet) {
        this.cxpCodigoEstRet = cxpCodigoEstRet;
    }

    public CxpTipoDocumento getCxpCodigoTipDoc() {
        return cxpCodigoTipDoc;
    }

    public void setCxpCodigoTipDoc(CxpTipoDocumento cxpCodigoTipDoc) {
        this.cxpCodigoTipDoc = cxpCodigoTipDoc;
    }
    
    
   
    
    @Override
    public int hashCode() {
        int hash = 0;
        hash += (cxcCodigoCabret != null ? cxcCodigoCabret.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof CxcCabeceraRetencion)) {
            return false;
        }
        CxcCabeceraRetencion other = (CxcCabeceraRetencion) object;
        if ((this.cxcCodigoCabret == null && other.cxcCodigoCabret != null) || (this.cxcCodigoCabret != null && !this.cxcCodigoCabret.equals(other.cxcCodigoCabret))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "emprsss.CxcCabeceraRetencion[ cxcCodigoCabret=" + cxcCodigoCabret + " ]";
    }
    
}
